package com.ssy.lingxi.order.entity;

import com.fasterxml.jackson.annotation.JsonBackReference;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 销售发货单商品实体类
 * @author wyx
 * @version 2.0.0
 * @date 2021-12-27
 */
@Entity
@Table(schema = "public", name = "ord_sell_delivery_goods_detail")
public class SellDeliveryGoodsDetailDO implements Serializable {
    private static final long serialVersionUID = 130144978890884675L;

    /**
     * id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ord_sell_delivery_goods_detail_seq")
    @SequenceGenerator(sequenceName = "ord_sell_delivery_goods_detail_seq", name = "ord_sell_delivery_goods_detail_seq", allocationSize = 1)
    private Long id;

    /**
     * 商品id
     */
    @Column(columnDefinition = "varchar(16)")
    private Long productId;

    /**
     * 商品名称
     */
    @Column(columnDefinition = "varchar(100)")
    private String name;

    /**
     * 商品品类
     */
    @Column(columnDefinition = "varchar(50)")
    private String category;

    /**
     * 商品品牌
     */
    @Column(columnDefinition = "varchar(50)")
    private String brand;

    /**
     * 计价单位
     */
    @Column(columnDefinition = "varchar(10)")
    private String unit;

    /**
     * 订单数量
     */
    @Column(columnDefinition = "numeric(15,2)")
    private BigDecimal orderQuantity;

    /**
     * 商品单价
     */
    @Column(columnDefinition = "numeric(15,3)")
    private BigDecimal price;

    /**
     * 发货数量
     */
    @Column(columnDefinition = "numeric(15,2)")
    private BigDecimal deliveryQuantity;

    /**
     * 收货数量
     */
    @Column(columnDefinition = "numeric(15,2)")
    private BigDecimal receiveQuantity;

    /**
     * 收货/发货金额
     */
    @Column(columnDefinition = "numeric")
    private BigDecimal amount;

    /**
     * 商品重量
     */
    @Column(columnDefinition = "numeric(15,3)")
    private BigDecimal weight;

    /**
     * 所属发货
     */
    @JsonBackReference
    @ManyToOne(cascade = CascadeType.MERGE, fetch = FetchType.LAZY)
    @JoinColumn(name = "delivery_Id", referencedColumnName = "id")
    private SellDeliveryGoodsDO deliveryGoods;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public BigDecimal getOrderQuantity() {
        return orderQuantity;
    }

    public void setOrderQuantity(BigDecimal orderQuantity) {
        this.orderQuantity = orderQuantity;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getDeliveryQuantity() {
        return deliveryQuantity;
    }

    public void setDeliveryQuantity(BigDecimal deliveryQuantity) {
        this.deliveryQuantity = deliveryQuantity;
    }

    public BigDecimal getReceiveQuantity() {
        return receiveQuantity;
    }

    public void setReceiveQuantity(BigDecimal receiveQuantity) {
        this.receiveQuantity = receiveQuantity;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public BigDecimal getWeight() {
        return weight;
    }

    public void setWeight(BigDecimal weight) {
        this.weight = weight;
    }

    public SellDeliveryGoodsDO getDeliveryGoods() {
        return deliveryGoods;
    }

    public void setDeliveryGoods(SellDeliveryGoodsDO deliveryGoods) {
        this.deliveryGoods = deliveryGoods;
    }
}
